package com.mybank.myaccounts.repository;

import com.mybank.common.entity.AccountApplication;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AccountApplicationRepository extends JpaRepository<AccountApplication, Long> {
    
    /**
     * Find all applications for a specific customer
     * 
     * @param customerId the customer ID
     * @return list of account applications
     */
    List<AccountApplication> findByCustomerCustomerId(Long customerId);
    
    /**
     * Find all applications with a specific status
     * 
     * @param status the application status
     * @return list of account applications
     */
    List<AccountApplication> findByStatus(String status);
    
    /**
     * Find all applications for a specific customer with a specific status
     * 
     * @param customerId the customer ID
     * @param status the application status
     * @return list of account applications
     */
    List<AccountApplication> findByCustomerCustomerIdAndStatus(Long customerId, String status);
}